import request from "@/utils/request.ts";

// 获取医院详情信息
export function getHospitalInfo(hospitalCode: string) {
    return request.get(`/hosp/hospital/${hospitalCode}`)
}

//获取医院科室信息
export function getHospitalDepartment(hoscode: string) {
    return request.get(`/hosp/hospital/department/${hoscode}`)
}

//获取可预约排班数据
export function getHospitalScheduleRule(page: number, limit: number, hoscode: string, depcode: string) {
    return request.get(`/hosp/hospital/auth/getBookingScheduleRule/${page}/${limit}/${hoscode}/${depcode}`)
}

// 获取医生排班数据
export function getHospitalScheduleDoctor(hoscode: string, depcode: string, workDate: string) {
    return request.get(`/hosp/hospital/auth/findScheduleList/${hoscode}/${depcode}/${workDate}`)
}

//获取就诊人信息
export function getHospitalPerson() {
    return request.get("/user/patient/auth/findAll")
}

export function getHospitalSchedulePerson(scheduleId: string) {
    return request.get(`/hosp/hospital/getSchedule/${scheduleId}`)
}


export function getCityProvince(parentId: string) {
    return request.get(`/cmn/dict/findByParentId/${parentId}`)
}

export function getCerType(dictCode: string) {
    return request.get(`/cmn/dict/findByDictCode/${dictCode}`)
}


export function adduserInfo(userInfo: any) {
    return request.post("/user/patient/auth/save", userInfo)
}

export function editUserInfo(userInfo: any) {
    return request.put("/user/patient/auth/update", userInfo)
}


export function removeByUserId(id: string) {
    return request.delete(`/user/patient/auth/remove/${id}`)
}

export function getOrderNo(hoscode: string, scheduleId: string, patientId: string) {
    return request.post(`/order/orderInfo/auth/submitOrder/${hoscode}/${scheduleId}/${patientId}`)
}
